package com.dao;

import com.domain.Product;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;


import java.util.List;

/**
 * 项目名称：ssm21
 * 类 名 称：IProductDao
 * 类 描 述：TODO
 */

public interface IProductDao {
    //查询所有产品信息
    @Select("select * from product")
    List<Product> findAll() throws Exception;

    // 添加产品
    @Insert("insert into product(productNum, productName, cityName, departureTime, productPrice, productDesc, productStatus) values (#{productNum},#{productName},#{cityName},#{departureTime},#{productPrice},#{productDesc},#{productStatus})")
    void save(Product product);

    // 根据id查询产品
    @Select("select * from product where id = #{id}")
    Product findById(String id) throws Exception;
}
